<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div>1</div>
		<div>2</div>
		<div>3</div>
		<script type="text/javascript">
			//-----------------数组---------------------------------------------
			const arr = [1, 2, 3];
			/* arr.forEach(function(val) {
				console.log(val);
			}) */
			// console.log(...arr);//1 2 3

			const arr2 = [4, 5, 6];

			//拆分:把数组拆分成以逗号分隔的参数序列
			const arr3 = [...arr, ...arr2];
			// console.log(...arr3);

			var arr4 = document.querySelectorAll("div"); //数组
			var arr5 = document.getElementsByTagName("div"); //伪数组

			var arr6 = Array.from(arr5);
			var arr7 = [...arr5];

			//-----------------对象---------------------------------------------
			const stu = {
				name: "张三",
				age: 20
			}
			
			const stu2 = {...stu,sex:"男"};
			console.log(stu2);
		</script>
	</body>
</html>
